import * as util from '../utils/util'

/**
 * 获取Openid
 */
export function getOpenid (code) {
  return util.myAjax({
    url: '/medical/wechat/get_mini_program_user_info_by_code',
    data: {
      fcode: code
    },
    showLoading: true,
    showFailMessage: 'modal'
  })
}

/**
 * 登录
 */
export function loginSys (data, options = {}) {
  return util.myAjax({
    url: '/medical/system/login',
    data,
    showLoading: false,
    showFailMessage: 'modal',
    ...options
  })
}
/**
 * 获取微信手机号
 */
export function getPhone (code) {
  return util.myAjax({
    url: '/medical/wechat/get_user_phone_by_code',
    data: {
      fcode: code
    },
    showLoading: true,
    showFailMessage: 'modal'
  })
}